package myoa.tool

import myoa.User

import javax.servlet.http.HttpSession


class SessionTool extends AbstractServletTool {
    /**
     * search session.loginUser for gsp file
     * search usage of SessionTool.loginUser
     * @return
     */
    static User getLoginUser() {
        session.loginUser
    }

    /**
     * For following case: No thread-bound request found
     * @param session
     * @return
     */
    static User getLoginUser(HttpSession session) {
        session.loginUser
    }

    static void setLoginUser(User loginUser) {
        session.loginUser = loginUser
    }
}
